﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using GameBase;

namespace GalaxyPresident
{
    public class City : CommonEntity
    {
        private static Texture2D texture1 = Constant.content.Load<Texture2D>(@"Resources/city1");
        private static Texture2D texture2 = Constant.content.Load<Texture2D>(@"Resources/city2");
        private static Texture2D texture3 = Constant.content.Load<Texture2D>(@"Resources/city3");
        private static Texture2D texture_s = Constant.content.Load<Texture2D>(@"Resources/city1");


        public City(Planet planet)
            : base(planet)
        {

            sprite_s = new Sprite(texture1, 1, 1,
                new List<int> { 0 }, 150);
            sprite = new Sprite(texture1, 1, 1,
                new List<int> { 0 }, 150);


            textures.Add(texture1);
            textures.Add(texture2);
            textures.Add(texture3);

            initSprites(planet);
            sprite.SetOriginPosition(new Vector2(sprite.Width / 2, sprite.Height - 30));
            sprite_s.SetOriginPosition(new Vector2(sprite_s.Width / 2, sprite_s.Height - 30));
        }

        public override string getObjectName()
        {
            return "City";
        }

        //public override void levelUp()
        //{
        //    base.levelUp();
        //    sprite.Texture = textures[level];
        //}

        //public override void levelDown()
        //{
        //    base.levelDown();
        //    sprite.Texture = textures[level];
        //}

        public override float getEconomicIncreaseAmount()
        {
            return 30 * (level+1);
        }

        public override string getInfoString()
        {
            string populationStr = "\nPopulation: " + ((int)((LivableBlock)_planetOwner.Blocks[BlockIndex]).Population).ToString();
            string economicStr =   "\nEconomic  : " + ((int)((LivableBlock)_planetOwner.Blocks[BlockIndex]).Economic).ToString();
            string happinessStr = "\nHappiness : " + ((int)((LivableBlock)_planetOwner.Blocks[BlockIndex]).Happiness).ToString();
            return base.getInfoString()
                + populationStr
                + economicStr
                + happinessStr;
        }
    }
}
